package com.hgc.controller;

import com.hgc.biz.IUserBiz;
import com.hgc.entity.User;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("user")
public class UserController {

    @Resource
    private IUserBiz userBiz;

    @Resource
    private DiscoveryClient client;

    @RequestMapping("find/{id}")
    public User findById(@PathVariable Integer id){
        return userBiz.findById(id);
    }

    @RequestMapping("discovery")
    public DiscoveryClient discovery(){
        return client;
    }
}
